<?php


namespace App\Http\Requests\Company;


use Illuminate\Support\Facades\Auth;

class AppraiseRequest extends BaseRequest
{
    public function rules()
    {
        return [
            'content' => 'required|min:6',
        ];
    }

    public function messages()
    {
        return [
            'content.required' => __('请输入评价内容'),
            'content.min' => __('评论内容不能少于:count个字', ['count' => 6]),
        ];
    }

    public function filldata()
    {
        $user  = Auth::user();
        return [
            'company_id' => (int)$user['login_company_id'],
            'content' => strip_tags(clean($this->post('content'))),
            'star'=>(int)$this->input('star',5),
            'user_id'=>(int)$this->input('user_id',1),
            'is_recommend'=>(int)$this->input('is_recommend',0),
            'photos'=>$this->input('photos',[])
        ];
    }
}
